/**
 * @type {Number}
 *
 * @properties={typeid:35,uuid:"48BA9AB6-412E-4D8F-9102-120BC7A648AD",variableType:4}
 */
var f_codigo_anterior = null;

/**
 * @type {String}
 *
 * @properties={typeid:35,uuid:"C2D7D9D8-4483-48DF-8EF5-B4C848CA4930"}
 */
var f_cuit = null;

/**
 * @type {String}
 *
 * @properties={typeid:35,uuid:"91070BA3-DA39-4E6D-ACC2-37D57E339B14"}
 */
var f_razon_social = null;

/**
 * Perform the element default action.
 *
 * @param {JSEvent} [event] the event that triggered the action
 *
 * @properties={typeid:24,uuid:"CFC1681B-0579-490B-987C-D7F784C6FA7B"}
 */
function Ira_clientes_det(event) 
{
	globals.mostrarForm("clientes_abm");
}

/**
 * Perform the element default action.
 *
 * @param {JSEvent} [event] the event that triggered the action
 *
 * @properties={typeid:24,uuid:"413ED7CD-27E9-4AB2-AC03-3C9A6E22717C"}
 * @AllowToRunInFind
 */
function buscar(event) 
{
	if(controller.find()==false)
	{
		globals.DIALOGS.showWarningDialog('Aviso','No encontró clientes (find)','OK')
		return ; 
	}

	if (f_codigo_anterior)
		cliente_id = f_codigo_anterior;
	
	if (f_razon_social)
		razon_social = '#%' + f_razon_social + '%';

	if (f_cuit)
		cuit = f_cuit;

	if (controller.search()==0)
	{
		globals.DIALOGS.showWarningDialog('Aviso','No encontró cliente en ese rango','OK')
		return;
	}
}

/**
 * Perform the element default action.
 *
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"BD0E1F0F-5B63-4A03-AE0D-292D8A6FC667"}
 */
function todos(event) 
{
	f_codigo_anterior	= null;
	f_razon_social		= null;
	f_cuit				= null;
}

/**
 * Callback method for when form is shown.
 *
 * @param {Boolean} firstShow form is shown first time after load
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"CEF52A9C-8AE6-4749-B80B-F337E4CE4A20"}
 */
function iniciar(firstShow, event) 
{
	f_codigo_anterior 	= null;
	f_razon_social		= null;
	f_cuit				= null;
}

/**
 * @properties={typeid:24,uuid:"869C4F46-BFC3-4E0D-9E95-0E72A2077D10"}
 */
function imprimir() {
	forms.clientes_impresion.controller.showPrintPreview()
	//plugins.jasperPluginRMI.runReport(foundset, 'ventas/clientes.jasper', null, plugins.jasperPluginRMI.OUTPUT_FORMAT.VIEW, {pRazonSocial: uservs_to_uservs.razon_social})
}

/**
 * @properties={typeid:24,uuid:"D2AB2202-F2DE-431D-8D10-01DC7102261E"}
 */
function pdf() {
	globals.metodoPdf('clientes_impresion','Listado_clientes',true)
}
